{include file="public/head"/} 
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a><cite>后台管理</cite></a>
        <a><cite>停车场地管理中心</cite></a>
        <a><cite>转账记录</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so"  method="get" action="">
          
		      <input type="text" class="layui-input" id="test5" name="start_time" placeholder="日期" {if isset($start_time)}value="{$start_time}"{/if}>
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button> 
        </form>
      </div>
      <xblock>
         &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
          未结算:<input type="text" class="layui-input" style="width:6%;display:inline-block;border-radius:5px;background:#CCCCCC;color:#000" readonly value="{$unpay_money}"/> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
          已结算:<input type="text" class="layui-input" style="width:6%;display:inline-block;border-radius:5px;background:#CCCCCC;color:#000" readonly value="{$pay_money}"/> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
	       <button class="layui-btn" onclick="orderDump('{$export}')"><i class="layui-icon"></i>批量导出</button>
      
        <span class="x-right" style="line-height:40px">共有数据：{$number} 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
            <th style="text-align: center; font-size: 16px;">日期</th>
			      <th style="text-align: center; font-size: 16px;">应到金额</th>
            <th style="text-align: center; font-size: 16px;">实到金额</th>
            <th style="text-align: center; font-size: 16px;">城市大脑收款</th>
            <th style="text-align: center; font-size: 16px;">付款状态</th>
			      <th style="text-align: center; font-size: 16px;">付款人</th>
            <th style="text-align: center; font-size: 16px;">联系方式</th>
            <th style="text-align: center; font-size: 16px;">操作</th>
            <th style="text-align: center; font-size: 16px;">备注</th>
          </tr>
        </thead>
        <tbody>
          {foreach $list as $lis}
          <tr>
			      <td style="text-align: center;">{$lis.day}</td>
            <td style="text-align: center;">{$lis.due_amount}</td>
            <td style="text-align: center;">{$lis.receipt_amount}</td>
            <td style="text-align: center;">{$lis.hzcity_money}</td>
            <td style="text-align: center;">
              {if $lis.state=="1"}未结算{/if}
              {if $lis.state=="2"}已结算{/if}
              
            </td>
            <td style="text-align: center;">{$lis.payer}</td>
            <td style="text-align: center;">{$lis.payer_phone}</td>
			      <td style="text-align: center;">
              {if $lis.state=="1"}
                 <input type="button" value="去结算" style="cursor: pointer;height:30px;width:50px;border-radius: 5px" onclick="transfer('{$lis.id}')"  id="{$lis.id}"/>
                 <input type="button" value="修改" style="cursor: pointer;height:30px;width:50px;border-radius: 5px" onclick="x_admin_show('修改','{:url('edit')}?id={$lis.id}',700,700)" />
                 <!--<a title="修改"  onclick="x_admin_show('修改','{:url('edit')}?id={$lis.id}',700,700)" href="javascript:;">
                  <i class="layui-icon">&#xe642;</i>
                </a>-->
              {/if}
                
            </td>
            <td style="text-align: center;">{$lis.remark}</td>
            
          </tr>
          {/foreach}
        </tbody>
      </table>
      <div class="page">
        <div>
            {$orderlist->render()}
        </div>
      </div>

    </div>
    <script>
		layui.use('laydate', function() {
            var laydate = layui.laydate;
            //日期时间选择器
            laydate.render({
                elem: '#test5'
                ,type: 'date'
            });
            //日期时间选择器
            laydate.render({
                elem: '#test6'
                ,type: 'datetime'
            });
        });
      
      function transfer(id){
        if(confirm('确定结算?')) 
        { 
          var url = "{:url('transfer')}?id=" + id
          // console.log(url)
           window.location.href=url
        } 
          return false; 
      } 
      function edit(id){
        
          var url = "{:url('edit')}?id=" + id
          // console.log(url)
           window.location.href=url
       
          return false; 
      } 
	  //批量导出
    function orderDump(exportid){
      var url = "{:url('orderExcel')}?&export=" + exportid;
        layer.open({
              type: 2,
              title: '批量导出账单',
              shadeClose: true,
              shade: 0.8,
              area: ['60%', '60%'],
              content: url //iframe的url
      });
    }

    </script>
    <script>var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
  </body>

</html>